package easy;

public class Solution_1460 {

    public boolean canBeEqual(int[] target, int[] arr) {
        int[] counts = new int[1001];
        for (int num : target) {
            counts[num]++;
        }
        for (int num : arr) {
            counts[num]--;
            if (counts[num] < 0) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        Solution_1460 model = new Solution_1460();
        System.out.println(model.canBeEqual(new int[]{1, 2, 3, 4}, new int[]{2, 4, 1, 3}));
    }
}
